Optimal. Leaf size=57 \[ -\frac{\left (a^2-b^2\right ) \log (\sin (e+f x))}{f}-\frac{(a+b)^2 \csc ^2(e+f x)}{2 f}-\frac{b^2 \log (\cos (e+f x))}{f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0805385, antiderivative size = 57, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {4138, 446, 88} \[ -\frac{\left (a^2-b^2\right ) \log (\sin (e+f x))}{f}-\frac{(a+b)^2 \csc ^2(e+f x)}{2 f}-\frac{b^2 \log (\cos (e+f x))}{f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4138
Rule 446
Rule 88
Rubi steps
\begin{align*} \int \cot ^3(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx &=-\frac{\operatorname{Subst}\left (\int \frac{\left (b+a x^2\right )^2}{x \left (1-x^2\right )^2} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac{\operatorname{Subst}\left (\int \frac{(b+a x)^2}{(1-x)^2 x} \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac{\operatorname{Subst}\left (\int \left (\frac{(a+b)^2}{(-1+x)^2}+\frac{a^2-b^2}{-1+x}+\frac{b^2}{x}\right ) \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac{(a+b)^2 \csc ^2(e+f x)}{2 f}-\frac{b^2 \log (\cos (e+f x))}{f}-\frac{\left (a^2-b^2\right ) \log (\sin (e+f x))}{f}\\ \end{align*}
Mathematica [A] time = 0.181189, size = 81, normalized size = 1.42 \[ -\frac{2 \left (a \cos ^2(e+f x)+b\right )^2 \left (2 \left (a^2-b^2\right ) \log (\sin (e+f x))+(a+b)^2 \csc ^2(e+f x)+2 b^2 \log (\cos (e+f x))\right )}{f (a \cos (2 (e+f x))+a+2 b)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.063, size = 78, normalized size = 1.4 \begin{align*} -{\frac{{a}^{2} \left ( \cot \left ( fx+e \right ) \right ) ^{2}}{2\,f}}-{\frac{{a}^{2}\ln \left ( \sin \left ( fx+e \right ) \right ) }{f}}-{\frac{ab}{f \left ( \sin \left ( fx+e \right ) \right ) ^{2}}}-{\frac{{b}^{2}}{2\,f \left ( \sin \left ( fx+e \right ) \right ) ^{2}}}+{\frac{{b}^{2}\ln \left ( \tan \left ( fx+e \right ) \right ) }{f}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.983106, size = 81, normalized size = 1.42 \begin{align*} -\frac{b^{2} \log \left (\sin \left (f x + e\right )^{2} - 1\right ) +{\left (a^{2} - b^{2}\right )} \log \left (\sin \left (f x + e\right )^{2}\right ) + \frac{a^{2} + 2 \, a b + b^{2}}{\sin \left (f x + e\right )^{2}}}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.527658, size = 231, normalized size = 4.05 \begin{align*} \frac{a^{2} + 2 \, a b + b^{2} -{\left (b^{2} \cos \left (f x + e\right )^{2} - b^{2}\right )} \log \left (\cos \left (f x + e\right )^{2}\right ) -{\left ({\left (a^{2} - b^{2}\right )} \cos \left (f x + e\right )^{2} - a^{2} + b^{2}\right )} \log \left (-\frac{1}{4} \, \cos \left (f x + e\right )^{2} + \frac{1}{4}\right )}{2 \,{\left (f \cos \left (f x + e\right )^{2} - f\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.40244, size = 339, normalized size = 5.95 \begin{align*} \frac{a^{2}{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} + 2 \, a b{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} + b^{2}{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} + 4 \, a^{2} \log \left (-\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 2\right ) - 4 \, b^{2} \log \left (-\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} - 2\right )}{8 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]